package com.net.oil.user.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.user.contract.UserDetailContract;
import com.net.oil.user.model.UserDetailModel;

/**
 * 作者：lch
 * 时间：2018/4/13 0013:下午 17:05
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class UserDetailPresenter extends BasePresenter<UserDetailContract.View> implements UserDetailContract.Presenter {

    private UserDetailContract.View view;
    private UserDetailContract.Model model;

    public UserDetailPresenter(UserDetailContract.View view) {
        this.view = view;
        model = new UserDetailModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void uploadImage(String path) {
        model.uploadImage(path);
    }

    @Override
    public void uploadImageSuccess(String result) {
        view.uploadImageSuccess(result);
    }

    @Override
    public void uploadImageFailed() {
        view.uploadImageFailed();
    }

    @Override
    public void setUserHeadId(String resourceId) {
        model.setUserHeadId(resourceId);
    }

    @Override
    public void setUserHeadIdSuccess() {
        view.setUserHeadIdSuccess();
    }

    @Override
    public void setUserHeadIdFailed() {
        view.setUserHeadIdFailed();
    }

    @Override
    public void updateNick(String nick) {
        model.updateNick(nick);
    }

    @Override
    public void updateNickSuccess() {
        view.updateNickSuccess();
    }

    @Override
    public void updateNickFailed() {
        view.updateNickFailed();
    }

    @Override
    public void sendRecommendUserInfo(String invitationPhone) {
        model.sendRecommendUserInfo(invitationPhone);
    }

    @Override
    public void sendRecommendUserInfoSuccess() {
        view.sendRecommendUserInfoSuccess();
    }

    @Override
    public void sendRecommendUserInfoFailed() {
        view.sendRecommendUserInfoFailed();
    }
}
